Skip to content

Instantly share code, notes, and snippets.

@karpathy
karpathy / min-char-rnn.py
Last active May 17, 2024 12:51
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@bmaupin
bmaupin / free-backend-hosting.md
Last active May 17, 2024 12:50
Free backend hosting
@awesome
awesome / strip HTML tags
Created November 3, 2009 16:29
ruby strip HTML tags
# copied from (thanks!): http://codesnippets.joyent.com/posts/show/615
str = <<HTML_TEXT
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<body>
<h1>Application error</h1>
<p>Change this error message for exceptions thrown outside of an action (like
in Dispatcher setups or broken Ruby code) in public/500.html</p>
@wojteklu
wojteklu / clean_code.md
Last active May 17, 2024 12:49
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@Starefossen
Starefossen / vim-cheats.md
Last active May 17, 2024 12:47
My vim cheat sheet for working with tabs and window splits.

Tabs

New Tab

  • :tabnew - new blank tab
  • :tabedit [file] - open file in tab

Cursor Movement

  • gt (:tabn) - next tab
@alieniasty
alieniasty / Kurwa.js
Created April 8, 2019 08:49
Skrypt dodający losową kurwę
javascript:{/** * Made by kurwa Kerai * chcesz rozpowszechniac? podawaj źródło * chcesz cos zmieniac? wszystkie komentarze pisz * w komentarzach wieloliniowych, bo sie moze popsuc pod chrome i opera... */var whitespace = "-\/|.,!:;'\" \t\n\r{}[]()";var stack = [];var curNIndex = 0;var curNode = null;var curIndex = -1;var state = 1;var lastword = '';String.prototype.startsWith = function(prefix) {return this.indexOf(prefix) === 0;};String.prototype.endsWith = function(suffix) {return this.match(suffix+"$") == suffix;};/* Nie moge tak robić niestety */function kurwizeLink(url){if(url.startsWith('javascript:'))return url; /* chyba niewiele moge zrobic kurwa */if(url.startsWith('#'))return url;if(url.startsWith('http://kurwa.keraj.net/?url='))return url; /* no, bo kurwa, bez jaj ;p */var base = '';if(!url.startsWith('http')){base = location.protocol + "://" + location.host;if(!url.startsWith('/')){var pathname = location.pathname;base += pathname.substring(0, pathname.lastIndexOf('/'));}}return 'http://kurwa.kera